/*
 * @Descripttion: 
 * @version: 
 * @Author: jwZhang
 * @Date: 2020-04-30 20:44:32
 * @LastEditors: jwZhang
 * @LastEditTime: 2020-05-10 16:53:54
 */
import 'package:cloud_music/route/route_handler.dart';
import 'package:cloud_music/ui/pages/undefined_page.dart';
import 'package:fluro/fluro.dart';

// https://juejin.im/post/5d051a5b6fb9a07ec07fbdc5#heading-21
class Routes {
  static String root = "/";
  static String home = "/home";
  static String login = "/login";

  // 生成 fluro 路由
  static void configureRoutes(Router router) {
    router.notFoundHandler = new Handler(
        handlerFunc: (context, params) => UndefinedPage(parameters: params));
    // 闪屏
    router.define(root, handler: splashHandler);
    // 登录
    router.define(login, handler: loginHandler);
    // 首页
    router.define(home, handler: homeHandler);
  }

  // 跳转可以使用, 不传入context, 例如需要重新登录
  // locator<NavigateService>().pushNamed('/');
}
